package com.atguigu.jxc.service.impl;

import com.atguigu.jxc.dao.UnitDao;

import com.atguigu.jxc.entity.Unit;

import com.atguigu.jxc.entity.Log;
import com.atguigu.jxc.service.UnitService;

import com.atguigu.jxc.service.LogService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @description
 */
@Service
public class UnitServiceImpl implements UnitService {

    @Autowired
    private UnitDao unitDao;
    @Autowired
    private LogService logService;


    @Override
    public Map<String, Object> getUnitList() {

        Map<String, Object> map = new HashMap<>();
        List<Unit> unit = unitDao.getUnitList();
        map.put("rows", unit);
        logService.save(new Log(Log.SELECT_ACTION, "单位"));
        return map;
    }


}
